package it.sandler.android.database;

/**
 * You can do what ever you want to do with SandlerDB.<br>
 * There are no restrictions. You can use SandlerDB for commercial use.<br>
 * <br>
 * Circle me on Google+: http://gplus.to/roberthahn<br>
 * SandlerDB on Google Code: http://code.google.com/p/sandler-db-for-android/<br>
 * <br>
 * Date: 04/16/2012
 * 
 * @author Robert Hahn
 * 
 */
public abstract class SandlerType<T> extends SandlerBaseType {

	private T value;

	protected static <T> SandlerType<T> create(
			Class<? extends SandlerType<T>> c, T defaultValue) {
		try {
			SandlerType<T> newInstance = c.newInstance();
			newInstance.set(defaultValue);
			return newInstance;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	protected void set(T value) {
		this.value = value;
	}

	protected T get() {
		return value;
	}

}
